package com.game.base.server.push.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.game.base.utils.NotificationsUtils;

import cn.bmob.push.PushConstants;

/**
 * 推送服务
 * Created by Su on 2019/5/7.
 */
public class PushMessageReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(PushConstants.ACTION_MESSAGE)) {
            Log.d("bmob_push", "客户端收到推送内容：" + intent.getStringExtra("msg"));

            //通知栏显示收到的反馈信息
            NotificationsUtils.showSimpleNotify(context, new Intent(), 1, null, "test", intent.getStringExtra("msg")
                    , "ticktext", System.currentTimeMillis());
        }
    }
}
